<?php
class Users extends Zend_Db_Table_Abstract {
	protected $_name = 'users';
	protected $_dependentTables = array('Characters', 'UsersGroups','Raidleaders','Usersignups','Raids','DkpStandings','DkpNormalizations');


	/**
	 * Short hand for getting a raid by its id.
	 * 
	 * This function does mysql safe escaping on the raid id.
	 *
	 * @param 	int 			raid id
	 * @return 	Zend_Db_Table_Row_Abstract|null
	 */
	public static function getById($userId)
	{	
		// Raid id must be numeric
		if (!is_numeric($userId)) {
			return null;
		}
		
		// Create static self
		$table = new self();
		
		// Create a select for getting the raid
		$select = $table->select()->where("id = ?", $userId);
		$user = $table->fetchRow($select);
		
		// Return the raid or null
		if ($user) {
			return $user;
		} else {
			return null;
		}
	}



}



?>